package ru.narod.amidoriya.app.sushibaramidoriya;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;
import android.provider.BaseColumns;

public class Zakaz extends SQLiteOpenHelper {
	private static final String dname = "amsushizakaz.db";
	private static final int dversion = 1;
	public static final String dtable = "zakazbludo";
	public static final String UID = "_id";
	public static final String DNAMEDISH = "dnamedish";
	public static final String DPRICE = "dprice";
	public static final String DDOSTAVKA = "ddostavka";
	public static final String DVES = "dves";
	public static final String DPIC = "dpic";
	public static final String DPICFULL = "dpicfull";
	public static final String DSOSTAV = "dsostav";
	public static final String DPAKET = "dpaket";
	public static final String DNAMEAKCIY = "dnameakciy";
	public static final String DBEGAKCIY = "dbegakciy";
	public static final String DENDAKCIY = "dendakciy";
	public static final String DBEGTIME = "dbegtime";
	public static final String DENDTIME = "dendtime";
	public static final String DPRICEAKCIY = "dpriceakciy";
	private static final String SQL_CREATE_T = "CREATE TABLE "
			+ dtable + " ("
			+ UID + " INTEGER PRIMARY KEY AUTOINCREMENT,"
			+ DNAMEDISH + " text,"+ DPRICE + " real,"+ DDOSTAVKA + " text,"
			+ DVES + " text,"+ DPIC + " text,"+ DPICFULL + " text,"+ DSOSTAV + " text"+");";
			/*+ DPAKET + " INTEGER,"
			+ DNAMEAKCIY + " text,"+ DBEGAKCIY + " text,"+ DENDAKCIY + " text,"
			+ DBEGTIME + " text,"+ DENDTIME + " text,"+ DPRICEAKCIY + " real"
			+");";*/
	private static final String SQL_DROP = "DROP TABLE IF EXISTS " + dtable;
	
	public Zakaz(Context context) {
		super(context, dname, null, dversion);
		// TODO Auto-generated constructor stub
	}

	@Override
	public void onCreate(SQLiteDatabase db) {
		// TODO Auto-generated method stub
		db.execSQL(SQL_CREATE_T);
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		// TODO Auto-generated method stub
		//db.execSQL(SQL_DROP);
		//onCreate(db);
	}

}
